summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/am/common_state_getter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/am/common_state_getter.cpp')
-rw-r--r--src/core/hle/service/am/common_state_getter.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/core/hle/service/am/common_state_getter.cpp b/src/core/hle/service/am/common_state_getter.cpp
index 77f3fd868..937ac0beb 100644
--- a/src/core/hle/service/am/common_state_getter.cpp
+++ b/src/core/hle/service/am/common_state_getter.cpp
@@ -60,7 +60,7 @@ ICommonStateGetter::ICommonStateGetter(Core::System& system_, std::shared_ptr<Ap
{91, nullptr, "GetCurrentPerformanceConfiguration"},
{100, nullptr, "SetHandlingHomeButtonShortPressedEnabled"},
{110, nullptr, "OpenMyGpuErrorHandler"},
- {120, nullptr, "GetAppletLaunchedHistory"},
+ {120, &ICommonStateGetter::GetAppletLaunchedHistory, "GetAppletLaunchedHistory"},
{200, nullptr, "GetOperationModeSystemInfo"},
{300, &ICommonStateGetter::GetSettingsPlatformRegion, "GetSettingsPlatformRegion"},
{400, nullptr, "ActivateMigrationService"},
@@ -271,6 +271,27 @@ void ICommonStateGetter::PerformSystemButtonPressingIfInFocus(HLERequestContext&
rb.Push(ResultSuccess);
}
+void ICommonStateGetter::GetAppletLaunchedHistory(HLERequestContext& ctx) {
+ LOG_WARNING(Service_AM, "(STUBBED) called");
+
+ std::shared_ptr<Applet> current_applet = applet;
+ std::vector<AppletId> result;
+
+ const size_t count = ctx.GetWriteBufferNumElements<AppletId>();
+ size_t i;
+
+ for (i = 0; i < count && current_applet != nullptr; i++) {
+ result.push_back(current_applet->applet_id);
+ current_applet = current_applet->caller_applet.lock();
+ }
+
+ ctx.WriteBuffer(result);
+
+ IPC::ResponseBuilder rb{ctx, 3};
+ rb.Push(ResultSuccess);
+ rb.Push(static_cast<u32>(i));
+}
+
void ICommonStateGetter::GetSettingsPlatformRegion(HLERequestContext& ctx) {
LOG_WARNING(Service_AM, "(STUBBED) called");